package com.demo.util;

public class MobileCode {

	private String mobile;
	private String code;
	private int rand;
	
	
	public MobileCode(String mobile, String code, int rand) {
		super();
		this.mobile = mobile;
		this.code = code;
		this.rand = rand;
	}
	
	public MobileCode(String mobile, String code) {
		super();
		this.mobile = mobile;
		this.code = code;
		this.rand = getRand();
	}
	public String getMobile() {
		return mobile;
	}
	public void setMobile(String mobile) {
		this.mobile = mobile;
	}
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	public int getRand() {
		long l = System.currentTimeMillis();
		return (int)l;
	}
	public void setRand(int rand) {
		this.rand = rand;
	}
	
	@Override
	public String toString() {
		StringBuilder sb = new StringBuilder("{");
		sb.append("'mobile'").append(":'").append(mobile).append("',").
		append("'code'").append(":'").append(code).append("',").
		append("'uuid'").append(":").append(rand).append("}");
		return sb.toString();
	}
	
	public static void main(String[] args) {
		MobileCode mo = new MobileCode("13552140385","666666");
		System.out.println(mo.toString());
	}
}
